class Solution(object):
    def countOperations(self, num1, num2):
        t = 0
        while num1 > 0 and num2 > 0:
            num1, num2 = max(num1, num2), min(num1, num2)
            if num1 % num2 == 0:
                return t + num1 // num2
            else:
                num1 -= num2
                t += 1
        return t